﻿<Window x:Class="XamlHelpmeet.UI.ExtractPropertiesToStyle.ExtractSelectedPropertiesToStyleWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Extract Selected Properties To Style"
        Width="427"
        Height="316">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Margin="0,5.5" Orientation="Horizontal">
            <TextBlock Margin="7,0"
                       VerticalAlignment="Center"
                       Text="Style Name" />
            <TextBlock x:Name="tbIsSilverlight3RequiredAstrick"
                       Margin="3,0"
                       VerticalAlignment="Center"
                       FontWeight="Bold"
                       Foreground="Red"
                       Text="*"
                       Visibility="Collapsed" />
            <TextBox Width="275" Text="{Binding Path=StyleName, Mode=TwoWay}" />
        </StackPanel>

        <ListView Grid.Row="1"
                  Margin="0,5.5"
                  ItemsSource="{Binding Path=ExtractedProperties}">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="175"
                                    DisplayMemberBinding="{Binding Path=PropertyName}"
                                    Header="Property Name" />
                    <GridViewColumn Width="150"
                                    DisplayMemberBinding="{Binding Path=PropertyValue}"
                                    Header="Property Value" />
                    <GridViewColumn Width="70" Header="Extract">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid Width="50">
                                    <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                </GridView>
            </ListView.View>
        </ListView>

        <Grid Grid.Row="2" Margin="0,5.5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="1"
                    Width="75"
                    Margin="3.5"
                    Command="{Binding Path=ExtractCommand}"
                    Content="Extract"
                    Padding="3.5" />
            <Button Grid.Column="2"
                    Width="75"
                    Margin="3.5"
                    Click="btnCancel_Click"
                    Content="Cancel"
                    Padding="3.5" />
        </Grid>

        <TextBlock Grid.Row="3"
                   Margin="0,5.5"
                   FontSize="10"
                   Foreground="DarkGray"
                   Text="Extract will remove selected properties creating a style that is copied into the clipboard" />
        <TextBlock x:Name="tbIsSilverlight3RequiredMessage"
                   Grid.Row="4"
                   Margin="0,5.5"
                   FontSize="12"
                   Foreground="Blue"
                   Text="Silverlight requires a style name."
                   Visibility="Collapsed" />
    </Grid>
</Window>
